package org.anderground.app.activity.map;

import org.anderground.app.AndergroundApp;

import android.os.Bundle;
import android.view.KeyEvent;

import com.google.android.maps.MapActivity;

/**
 * @author Eldar Abusalimov
 */
public class MetroMapActivity extends MapActivity {

	public static final String API_KEY = "0gUSX2PziJSOMo8liDpG9XySrn8pHR2v8Ich8Sw";

	@Override
	protected void onCreate(Bundle icicle) {
		super.onCreate(icicle);

        setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
		setContentView(new MetroMapView(this, API_KEY,
				(AndergroundApp) getApplication()));
	}

	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.app.Activity#onKeyDown(int, android.view.KeyEvent)
	 */
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (event.getKeyCode() == KeyEvent.KEYCODE_BACK
				&& ((AndergroundApp) getApplication()).getStateStack()
						.popState()) {
			return true;
		}
		return super.onKeyDown(keyCode, event);
	}

}
